Maximum binomial coefficient term value
Given a positive integer n. The task is to find the maximum coefficient term in all binomial coefficient. The binomial coefficient series is nC0, nC1, nC2, …., nCr, …., nCn-2, nCn-1, nCn the task is to find maximum value of nCr....
read more
Find the number of ways to draw the last colored ball
Given an array balls[] representing the count of colored balls labeled from 1 to k, the task is to determine the number of ways to draw the last ball of color i before drawing the last ball of color i + 1 for all i from 1 to k – 1....
read more
Count sequences of given length having non-negative prefix sums that can be generated by given values
Given two integers M and X, the task is to find the number of sequences of length M that can be generated comprising X and -X such that their respective counts are equal and the prefix sum up to each index of the resulting sequence is non-negative....
read more
Sum of product of consecutive Binomial Coefficients
Given a positive integer n. The task is to find the sum of product of consecutive binomial coefficient i.e nC0*nC1 + nC1*nC2 + ….. + nCn-1*nCn...
read more
Narayana number
In combinatorics, the Narayana numbers N(n, k), n = 1, 2, 3 …, 1 ? k ? n, form a triangular array of natural numbers, called the Narayana triangle. It is given by :Narayana numbers N(n, k) can be used to find the number of expressions containing n-pairs of parentheses, which are correctly matched and which contain k distinct nesting. For instance, N(4, 2) = 6 as with four pairs of parentheses six sequences can be created which each contain two times the sub-pattern ‘()’ :...
read more
Program to find the value of sin(nΘ)
Given the value of sin(?) and a variable n<=15. The task is to find the value of sin(n?) using property of trigonometric functions.Examples:...
read more
Count permutations of given array that generates the same Binary Search Tree (BST)
Given an array, arr[] of size N consisting of elements from the range [1, N], that represents the order, in which the elements are inserted into a Binary Search Tree, the task is to count the number of ways to rearrange the given array to get the same BST....
read more
Ways to Remove Edges from a Complete Graph to make Odd Edges
Given a complete graph with N vertices, the task is to count the number of ways to remove edges such that the resulting graph has odd number of edges....
read more
Program to print binomial expansion series
Given three integers, A, X and n, the task is to print terms of below binomial expression series. (A+X)n = nC0AnX0 + nC1An-1X1 + nC2An-2X2 +….+ nCnA0Xn Examples:...
read more
Program to Find the value of cos(nΘ)
Given a value of cos(?) and a variable . The task is to find the value of cos(n?) using property of trigonometric functions.Note: n <= 15.Examples:...
read more
Number of distinct subsets of a set
Given an array of n distinct elements, count total number of subsets....
read more
Binomial Coefficient | DP-9
The following are the common definitions of Binomial Coefficients....
read more